package cn.rongdao.jrkabao.model.remind;

import com.mifengkong.frtools.http.request.HttpFunction;
import com.mifengkong.frtools.util.FRString;

import cn.rongdao.jrkabao.model.api.BaseKaMaoModel;
import io.reactivex.Observable;
import io.reactivex.Observer;

/**
 * Created by jack on 2017/12/5
 */

public class RemindChangeRepayStatusModel extends BaseKaMaoModel {

    public static RemindChangeRepayStatusModel getInstance() {
        return getPresent(RemindChangeRepayStatusModel.class);
    }

    public void execute(String remindId, boolean isRepaymentSelect, Observer<String> observer) {
        addParamStrings("id", FRString.valueOf(remindId));
        addParamStrings("type", isRepaymentSelect ? "1" : "2");
        Observable<String> observable = mServletApi.changeRepayStatus(mParams).map(new HttpFunction<String>());
        toSubscribe(observable, observer);
    }
}
